package cc.comac.mom.service.impl;

import java.util.List;

import cc.comac.mom.bean.EquipPersonnelQualificationManagementOtherInterferBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipPersonnelQualificationManagementService;
import cc.comac.mom.bean.EquipPersonnelQualificationManagement;
import cc.comac.mom.bean.EquipPersonnelQualificationManagementBean;
import cc.comac.mom.datahandlers.entity.EquipPersonnelQualificationManagementDataHandler;
import cc.comac.mom.util.ResultBean;

@RestController
@Service
@Transactional
public class EquipPersonnelQualificationManagementServiceImpl implements EquipPersonnelQualificationManagementService{

	@Autowired
	private EquipPersonnelQualificationManagementDataHandler equipPersonnelQualificationManagementDataHandler;

	@Override
	public ResultBean insertEquipPersonnelQualificationManagement(
			@RequestBody EquipPersonnelQualificationManagement equipPersonnelQualificationManagement) {
		ResultBean insertEquipPersonnelQualificationManagement = equipPersonnelQualificationManagementDataHandler.insertEquipPersonnelQualificationManagement(equipPersonnelQualificationManagement);
		return insertEquipPersonnelQualificationManagement;
	}

	@Override
	public ResultBean updateEquipPersonnelQualificationManagement(
			@RequestBody EquipPersonnelQualificationManagement equipPersonnelQualificationManagement) {
		ResultBean updateEquipPersonnelQualificationManagement = equipPersonnelQualificationManagementDataHandler.updateEquipPersonnelQualificationManagement(equipPersonnelQualificationManagement);
		return updateEquipPersonnelQualificationManagement;
	}

	@Override
	public ResultBean batchDelete(@RequestBody List<EquipPersonnelQualificationManagement> list) {
		ResultBean batchDelete = equipPersonnelQualificationManagementDataHandler.batchDelete(list);
		return batchDelete;
	}

	@Override
	public ResultBean selectbySomeFields(@RequestBody EquipPersonnelQualificationManagementBean equipPersonnelQualificationManagementBean) {
		ResultBean resultBean = new ResultBean(true);
		if (equipPersonnelQualificationManagementBean.getIsSearch() != 1) {
			 resultBean = equipPersonnelQualificationManagementDataHandler.selectbySomeFields(equipPersonnelQualificationManagementBean);
		}else {
			resultBean = equipPersonnelQualificationManagementDataHandler.selectAllData();
		}
		return resultBean;
	}

	@Override
	public ResultBean batchsave(@RequestBody List<EquipPersonnelQualificationManagementOtherInterferBean> personnel) {
		ResultBean bean=equipPersonnelQualificationManagementDataHandler.batchsave(personnel);
		return  bean;
	}
}
